package o;

import android.view.View;
import android.view.ViewGroup;

public abstract class SomeFragmentStateAdapter extends FragmentStatePagerAdapter {
    public SomeFragmentStateAdapter(FragmentManager juVar) {
        super(juVar);
    }

    public void destroyItem(ViewGroup viewGroup, int i, Object obj) {
        if (isRTL()) {
            i = (getCount() - i) - 1;
        }
        super.destroyItem(viewGroup, i, obj);
    }

    public void destroyItem(View view, int i, Object obj) {
        if (isRTL()) {
            i = (getCount() - i) - 1;
        }
        super.destroyItem(view, i, obj);
    }

    public int getItemPosition(Object obj) {
        int position = super.getItemPosition(obj);
        if (!isRTL()) {
            return position;
        }
        if (position == -1 || position == -2) {
            return -2;
        }
        return (getCount() - position) - 1;
    }

    public CharSequence getPageTitle(int i) {
        if (isRTL()) {
            i = (getCount() - i) - 1;
        }
        return super.getPageTitle(i);
    }

    public float getPageWidth(int i) {
        if (isRTL()) {
            i = (getCount() - i) - 1;
        }
        return super.getPageWidth(i);
    }

    public Object instantiateItem(ViewGroup viewGroup, int i) {
        if (isRTL()) {
            i = (getCount() - i) - 1;
        }
        return super.instantiateItem(viewGroup, i);
    }

    public Object instantiateItem(View view, int i) {
        if (isRTL()) {
            i = (getCount() - i) - 1;
        }
        return super.instantiateItem(view, i);
    }

    public void setPrimaryItem(ViewGroup viewGroup, int i, Object obj) {
        if (isRTL()) {
            i = (getCount() - i) - 1;
        }
        super.setPrimaryItem(viewGroup, i, obj);
    }

    protected boolean isRTL() {
        return MinimumFactory.getBoolValue(ContentManager.getInstant().getContext());
    }
}
